package com.lagou.springbootjob.service.impl;

import com.lagou.springbootjob.bean.BlogArticle;
import com.lagou.springbootjob.dao.BlogDao;
import com.lagou.springbootjob.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl implements BlogService {

    @Autowired
    private BlogDao blogDao;

    @Override
    public List<BlogArticle> findAll() {
        List<BlogArticle> blogArticleList = blogDao.findAll();
        return blogArticleList;
    }

    @Override
    public Page<BlogArticle> findAll(Pageable pageable) {
        Page<BlogArticle> articlePage = blogDao.findAll(pageable);

        return articlePage;
    }
}
